<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="AnswersEditDlg" widgetVar="AnswersEditDialog" modal="true" resizable="false"  appendTo="@(body)" header="#{myBundle.EditAnswersTitle}" closeOnEscape="true">

            <h:form id="AnswersEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{answersController.selected != null}">

                        <h:outputLabel value="#{myBundle.EditAnswersLabel_id}" for="id" />
                        <h:outputText id="id" value="#{answersController.selected.id}" />


                        <p:outputLabel value="#{myBundle.EditAnswersLabel_tid}" for="tid" />
                        <p:inputText id="tid" value="#{answersController.selected.tid}" title="#{myBundle.EditAnswersTitle_tid}"/>


                        <p:outputLabel value="#{myBundle.EditAnswersLabel_fid}" for="fid" />
                        <p:inputText id="fid" value="#{answersController.selected.fid}" title="#{myBundle.EditAnswersTitle_fid}"/>


                        <p:outputLabel value="#{myBundle.EditAnswersLabel_user}" for="user" />
                        <p:inputTextarea rows="4" cols="30" id="user" value="#{answersController.selected.user}" title="#{myBundle.EditAnswersTitle_user}" />


                        <p:outputLabel value="#{myBundle.EditAnswersLabel_topic}" for="topic" />
                        <p:inputTextarea rows="4" cols="30" id="topic" value="#{answersController.selected.topic}" title="#{myBundle.EditAnswersTitle_topic}" />


                        <p:outputLabel value="#{myBundle.EditAnswersLabel_text}" for="text" />
                        <p:inputTextarea rows="4" cols="30" id="text" value="#{answersController.selected.text}" title="#{myBundle.EditAnswersTitle_text}" />


                        <p:outputLabel value="#{myBundle.EditAnswersLabel_created}" for="created" />
                        <p:calendar id="created" pattern="MM/dd/yyyy HH:mm:ss" value="#{answersController.selected.created}" title="#{myBundle.EditAnswersTitle_created}" required="true" requiredMessage="#{myBundle.EditAnswersRequiredMessage_created}" showOn="button"/>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{answersController.save}" value="#{myBundle.Save}" update="display,:AnswersListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,AnswersEditDialog);">
                        <p:confirm header="#{myBundle.ConfirmationHeader}" message="#{myBundle.ConfirmEditMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="AnswersEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
